<template>
    <button @click="count++">内联事件绑定</button>
    <p>{{ count }}</p>
    <button @click="clickEnth">方法事件绑定</button>
    <p>{{ count }}</p>
    <div @click="clickEnthHavCan"><span>获取event对象</span></div>
    <div @click="transData(value)" v-for="(value,index) of names" :key="index">数据传参：{{ value }}</div>
    <div @click="transData(value,$event)" v-for="(value,index) of names" :key="index">
        数据传参和event对象：{{ value }}</div>
</template>
<script>
    export default {
        data(){
            return{
                count : 0,
                names:["zhangsan","lisi"]
            }
        },
        methods:{
            clickEnth(){
                this.count++
            },
            clickEnthHavCan(e){
                e.target.innerHTML = "<p>参数获取" + this.count+"</p>",
                this.count++
            },
            transData(msg,e){
                window.alert(msg)
                console.log(e)
            }
        }
    }

</script>